/*******************************************************************************
 *
 *      Filename: test_Timer.cpp
 *   Description: Test for timer class
 *        Author: [kb]ypp
 *    Created at: November 28, 2005
 * Last modified: 
 *
 ******************************************************************************/

#include "../Timer.h"
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main()
{
	Timer stopped;
	Timer running;
	running.start();
	
	cout.setf( ios::fixed, ios::floatfield );
	cout.setf( ios::showpoint );
	cout.precision( 6 );
	
	float se, re, d, k, d_sum = 0;
	for ( int i = 0; i < 50; ++i ) {
		se = stopped.elapsed();
		re = running.elapsed();
		d_sum += ( d = running.delta() );
		for ( int j = 0; j < 100 * i * i * i; ++j )
			++k;
		cout << "stopped: " << setw( 5 ) << se << '\t'
			 << "delta:   " << setw( 5 ) <<  d << '\t'
			 << "running: " << setw( 5 ) << re << endl;
	}
	
	cout << "d_sum: " << d_sum << '\t' << "elapsed: " << re << endl;
	
	return 0;
}
